<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title></title>
		<link href="css/bootstrap.min.css" rel="stylesheet">
		<link href="css/font-awesome.min.css" rel="stylesheet">
		<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
		<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
		<!--[if lt IE 9]>
    <script src="js/html5shiv.min.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
		<style type="text/css">
			body {
				padding-top: 0;
			}
		</style>
	</head>

	<body>

		<div class="container-fluid">
			<form id="sbmit">
				<input id="id" name="id" type="hidden" />
				<table class="table table-striped table-condensed">
					<tbody>
						<tr>
							<th class="text-right">英文</th>
							<td>
								<input type="text" class="form-control" id="english" placeholder="英文字母" name="transcript" value="" required autofocus>
							</td>
						</tr>
						
						<tr>
							<th class="text-right">中文</th>
							<td>
								<input type="text" class="form-control" id="china" name="translation" placeholder="中文字母" value="" required>
							</td>
						</tr>
						<tr>
							<th class="text-right">开始时间</th>
							<td>
								<input type="text" class="form-control" id="start" name="cue_start" placeholder="开始时间" value="" required>
							</td>
						</tr>
						<tr>
							<th class="text-right">结束时间</th>
							<td>
								<input type="text" class="form-control" id="end" name="cue_end" placeholder="结束时间" value="" required>
							</td>
						</tr>
						<tr>
							<th class="text-right">字母ID</th>
							<td>
								<input type="text" class="form-control" id="myid" name="myid" placeholder="字母ID" value="" required>
							</td>
						</tr>
						<tr><th></th><td class="text-right"><button type="button" class="btn btn-primary" id="btn-sub">保存编辑</button></td></tr>
					</tbody>
				</table>
			</form>
		</div>

		<script src="js/jquery.min.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="js/url.min.js"></script>
		<script src="js/common.js"></script>
		<script language="JavaScript">
			var id = $.url('?id');
			var page = $.url('?page');
			var type = $.url('?type');
			var key = $.url('?key');
			var opts = {
				"page": (page != null) ? page : 1,
				"count": 10
			};
			$(function() {
				if(key != null && key != "") {
					$("#key").val(key);
					opts.key = key;
				}
				if(type != null && type != "") {
					$("#type").val(type);
					opts.type = type;
				}
				if(id != null && id != "") {
					$("#id").val(id);
					opts.id = id;
				}
				console.info(opts);
				api.childcategorylist(opts);
				//				api.comicCateGoryList();
			})
			$("#btn-sub").on("click", function() {
				if($("#english").val() != "" && $("#china").val() != "" && $("#start").val() != "" && $("#end").val() != "" && $("#myid").val() != ""){
					$.post(api_cfg.domain + "comments_add",$("#sbmit").serialize(),function(data){
						if(data.err==0){
							parent.reLoad();
						}else{
							msg("error");
						}
					});					
				}
			});
		</script>
	</body>

</html>